<?php

namespace JsonLowCode\UI;

use JsonLowCode\Schema;
use JsonLowCode\Traits\Props\HasDescription;
use JsonLowCode\Traits\Props\HasHugeSize;
use JsonLowCode\Traits\Props\HasTitle;
use JsonLowCode\Traits\Slots\HasSlotFooter;
use JsonLowCode\Traits\Slots\HasSlotIcon;

/**
 * 结果页是展示结果的。 NResult
 * @method static Result make(string $title = null,mixed $children = null) Result组件
 */
class Result extends Schema
{
    protected string $componentName = "NResult";

    use HasHugeSize, HasTitle, HasDescription;

    use HasSlotFooter, HasSlotIcon;

    public function __construct(string $title = null,mixed $children = null)
    {
        parent::__construct();
        $title!=null && $this->title($title);
        $this->children($children);
    }

    /**
     * 设置组件状态
     * @param string $status  'info' | 'success' | 'warning' | 'error' | '404' | '403' | '500' | '418'
     * @return $this
     */
    public function status(string $status = 'info' | 'success' | 'warning' | 'error' | '404' | '403' | '500' | '418'): static
    {
        return $this->prop('status',$status);
    }
}
